﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Web.Script.Serialization;
using log4net;

namespace Et.Open.Socket.Demo.core
{
    public class EmptyApiProcessor : IApiProcessor
    {
        private static readonly ILog log = LogManager.GetLogger(typeof(EmptyApiProcessor));

        private JavaScriptSerializer ser = new JavaScriptSerializer();

        public ApiData Process(ApiData data)
        {
            log.Info((object)string.Format("got [%d] api data: %s", data.DataType, data.Data));
            return new ApiData
            {
                DataType = ushort.MaxValue,
                Data = ser.Serialize(new ApiRespBase
                {
                    errorCode = 127,
                    errorMsg = "尚未实现"
                })
            };
        }
    }
}
